package com.walkline.travelassistant.dao;

import org.json.me.JSONObject;

import com.walkline.travelassistant.TravelAssistantException;
import com.walkline.travelassistant.TravelAssistantSDK;
import com.walkline.travelassistant.inf.Step;

public class TravelAssistantStep extends TravelAssistantObject implements Step
{
	private String _instruction = "";
	private String _step_instruction = "";
	private String _path = "";
	private String _scheme_name = null;

	public TravelAssistantStep(TravelAssistantSDK travelAssistant, JSONObject jsonObject) throws TravelAssistantException
	{
		super(travelAssistant, jsonObject);

		JSONObject stepObject = jsonObject;
		if (stepObject != null)
		{
			_instruction = stepObject.optString("instructions");
			_step_instruction = stepObject.optString("stepInstruction");
			_path = stepObject.optString("path");

			if (!stepObject.isNull("vehicle"))
			{
				_scheme_name = stepObject.optJSONObject("vehicle").optString("name");
			}
		}
	}

	public String getInstruction() {return _instruction;}

	public String getStepInstruction() {return _step_instruction;}

	public String getPath() {return _path;}

	public String getSchemeName() {return _scheme_name;}
}